package com.example.rollBook;

import android.app.Activity;
import android.os.Bundle;
import android.widget.ListView;

import com.lyq.db.StudentAdapter;
public class AllRecordActivity extends Activity {
	private StudentListViewAdapter adapter;

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_all_record);
		initListView();
	}

	@Override
	protected void onResume() {
		super.onResume();
		updateList();
	}

	private void initListView() {
		adapter = new StudentListViewAdapter(this, null);
		ListView l = (ListView) findViewById(R.id.aty_student_list);
		l.setAdapter(adapter);
	}

	private void updateList() {
		adapter.setData(StudentAdapter.getInstance(this).getAllStudents());
	}
}
